﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace MyFeer.Widget.Grid.Editor
{
    public class TextCellEditor:ICellEditor
    {
        private TextBox textBox;
        
        public TextCellEditor()
        {
        }
        public Control createControl()
        {
            textBox = new TextBox();
            textBox.Loaded += new RoutedEventHandler(textBox_Loaded);
            return textBox;
        }

        void textBox_Loaded(object sender, RoutedEventArgs e)
        {
            textBox.Focus();
        }
        public Control getControl()
        {
            return this.textBox;
        }
        public void SetValue(String value)
        {
            if(value!=null)
                this.textBox.Text = value;
        }
        public String GetValue()
        {
            return this.textBox.Text;
        } 
    }
}
